package cn.wolfcode.mapper;

import cn.wolfcode.domain.Employee;
import cn.wolfcode.domain.Role;
import cn.wolfcode.qo.QueryObject;
import lombok.extern.java.Log;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    int updateByPrimaryKey(Employee record);


    //分页查询
    List<Employee> selectAll(QueryObject qo);

    //插入关系
    void insertRelation(@Param("empId") Long empId,@Param("roleIds") Long[] roleIds);

    //额外SQL方式查询用户拥有的角色权限
    Employee selectOne(Long id);

    Employee selectByUsernameAndPassword(@Param("username") String username,@Param("password") String password);
    //查询所有员工
    List<Employee> queryAll();
    //查询用户名
    Employee selectByUsername(String username);

    void updateUserStatus(@Param("id") Long id, @Param("status") Boolean status);

    void status(@Param("status") boolean status, @Param("id") Long id);

    void batchDelete(@Param("ids") Long[] ids);

    void updatePwdById(@Param("id") Long id, @Param("newPassword") String newPassword);
}